<template>
	<view style="position: relative;">
		<image class="img" src="./1004icon2.png" mode="widthFix"></image>
		<image class="img1" src="./1004icon1.png" mode="widthFix"></image>
		<view class="backBtn" @tap="backBtn"></view>
		<view class="backBtn1" @tap="backBtn1"></view>
		<view class="backBtn2" @tap="backBtn2"></view>
		<view class="list1">{{'Hi '+userInfo.nickName+'，'+timetxt}}</view>
	</view>
</template>

<script>
	const http = require('../../../utils/http.js');
	export default {
		data() {
			return {
				list:null,
				kaNum:null,
				userInfo:null,
				timetxt:null
			}
		},
		onLoad(options) {
			this.id=options.id
		},
		onShow() {
			uni.showLoading({
			    title: '加载中'
			});
			http.get('/api/user/accountInfo').then(res => {
				if (res.code == 200 && res.result) {
					this.userInfo=res.result
				}
				uni.hideLoading();
			})
			this.timetxt1()
		},
		methods: {
			backBtn:function(){
				uni.navigateBack({
					delta: 1
				})
			},
			backBtn1:function(){
				uni.navigateTo({
				    url: '1004-2?id='+this.id
				});
			},
			backBtn2:function(){
				uni.navigateTo({
				    url: '1004-1?id='+this.id
				});
			},
			timetxt1:function(){
				
				var that=this
				var now = new Date(),hour = now.getHours() 
				if(hour < 6){that.timetxt="上午好"} 
				else if (hour < 9){that.timetxt="上午好"} 
				else if (hour < 12){that.timetxt="上午好"} 
				else if (hour < 14){that.timetxt="下午好"} 
				else if (hour < 17){that.timetxt="下午好"} 
				else if (hour < 18){that.timetxt="下午好"} 
				else if (hour < 22){that.timetxt="晚上好"} 
				else {that.timetxt="晚上好！"}
			}
		}
	}
</script>

<style>
	.backBtn{
		width: 10vw;
		height: 10vw;
		position: absolute;
		top: 9vw;
		left: 4vw;
	}
	.list1{
		position: absolute;
		top: 28vw;
		left: 24vw;
		font-size: 4vw;
		color: #FFFFFF;
	}
	.backBtn1{
		width: 18vw;
		height: 18vw;
		position: absolute;
		top: 52.5vw;
		left: 77vw;
	}
	.backBtn2{
		width: 18vw;
		height: 18vw;
		position: absolute;
		top: 52.5vw;
		left: 4vw;
	}
	.img{
		width: 100%;
	}
	.img1{
		width: 100%;
		position: fixed;
		bottom: 0;
		left: 0;
	}
</style>
